package com.hackerrank.challenges.saveprincess;

import java.util.Scanner;

public class Solution {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt(), mr = N / 2, mc = N / 2, pr = 0, pc = 0;
		in.nextLine();
		for(int n = 0; n < N; n++) {
			String l = in.nextLine();
			int i;
			if((i = l.indexOf('m')) >= 0) {
				mc = i;
				mr = n;
			}
			if((i = l.indexOf('p')) >= 0) {
				pc = i;
				pr = n;
			}
		}
		int dr = mr - pr, dc = mc - pc;
		for(int i = dr; i < 0; i++)
			System.out.println("DOWN");
		for(int i = 0; i < dr; i++)
			System.out.println("UP");
		for(int i = dc; i < 0; i++)
			System.out.println("RIGHT");
		for(int i = 0; i < dc; i++)
			System.out.println("LEFT");
	}
}
